{  Statement: http://acmp.ru/?main=task&id_task=53
   Verdict: Accepted
}
uses
    SysUtils, Math;

var
    i, j, n, m : longint;
    a, f : array[0..1010, 0..1010] of longint;
    ans : array[0..10] of longint;

procedure make(k : longint);

var
    i, j : longint;

begin
    for i := 1 to n do
        for j := 1 to m do
            if a[i][j] mod k = 0 then f[i][j] := k;
end;

begin
    reset(input,'input.txt');
    rewrite(output,'output.txt');
    read(n, m);
    for i := 1 to n do
        for j := 1 to m do
            a[i][j] := i * j;
    make(2);
    make(3);
    make(5);
    fillchar(ans, sizeof(ans), 0);
    for i := 1 to n do
        for j := 1 to m do
            inc(ans[f[i][j]]);
    writeln('RED : ', ans[2]);
    writeln('GREEN : ', ans[3]);
    writeln('BLUE : ', ans[5]);
    writeln('BLACK : ', ans[0]);
end.
